package com.tuanquan.flutter_plugin_tengxunvideo.player;

import android.app.Activity;
import android.content.Context;



import java.util.Map;

import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

public class FlutterTXPlayerViewFactory extends PlatformViewFactory {

    private final BinaryMessenger messenger;
    private final Activity activity;

    public FlutterTXPlayerViewFactory(BinaryMessenger messenger, Activity activity) {
        super(StandardMessageCodec.INSTANCE);
        this.messenger = messenger;
        this.activity = activity;
    }


    @SuppressWarnings("unchecked")
    @Override
    public PlatformView create(Context context, int id, Object args) {
        Map<String, Object> params = (Map<String, Object>) args;
        return new FlutterTXPlayerView(context, messenger, id, params,activity);
    }
}
